var http = require('http');
var url = require('url');

function start(route) {
    http.createServer(function (request, response) {
        var path = url.parse(request.url).pathname;
        console.log('execute --> ', path);

        route(path);

        response.writeHead(200, { "Content-Type": "text/plain" });
        response.write('hello world');
        response.end();
        console.log('response hello');
    }).listen(8080);
    console.log('server start....')
}

exports.start = start;